package com.mhc.haval.api.service;

import com.mhc.haval.api.dto.StaffDTO;
import com.mhc.haval.api.dto.StaffRoleDTO;
import com.mhc.haval.exception.HavalCommonException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by HMJ on 2017/8/31.
 */
@FeignClient("HAVAL")
@RequestMapping("/feign/IStaffRoleService")
public interface IStaffRoleService {

    /**
     * 根据角色code查找用户
     *
     * @param roleCode 角色code
     * @return 返回用户列表
     */
    @RequestMapping(value = {"/selectStaffByRole"}, method = {RequestMethod.GET})
    List<StaffRoleDTO> selectStaffByRole(@RequestParam("roleCode") String roleCode) throws HavalCommonException;


    /**
     * 根据员工id查询员工信息
     *
     * @param staffId
     * @return
     */
    @RequestMapping(value = {"/selectByStaffName"}, method = {RequestMethod.GET})
    StaffDTO selectByStaffName(@RequestParam("staffId") Long staffId) throws HavalCommonException;

    /**
     * 根据部门id查询员工列表
     *
     * @param deptId
     * @return
     */
    @RequestMapping(value = {"/getStaffByDeptId"}, method = {RequestMethod.GET})
    List<StaffDTO> getStaffByDeptId(@RequestParam("deptId") Long deptId) throws HavalCommonException;

    /**
     * 根据角色code查找角色
     *
     * @param roleCode 角色code
     * @return
     */
    @RequestMapping(value = {"/selectRole"}, method = {RequestMethod.GET})
    Long selectRole(@RequestParam("roleCode") String roleCode) throws HavalCommonException;

}
